import { withRouter } from 'next/router'
// 组件
import Main from '@/pages_components/order/Main'

const Order = function ({ query, fullPath }){
    const { order: [goodsId] } = query;
    return (
        <Main
            target="/car"
            routes={[
                { name: '用车包车', url: '/car' }, 
                { name: '用车详情', url: `/car/${goodsId}.html` }, 
                { name: '用车预订', url: fullPath }
            ]}
            query={query}
        />
    )
}

Order.getInitialProps = async (ctx) => {
    if (ctx) {
        return { query: ctx.query, fullPath: ctx.asPath }
    }
    return {}
}

export default withRouter(Order)

